﻿#ifndef ADDFRIENDWIDGET_H
#define ADDFRIENDWIDGET_H
#include <QWidget>
#include<unordered_map>
#include<QMessageBox>
#include "message.h"
#include"SocketHelper.h"
namespace Ui {
class AddFriendWidget;
}

class AddFriendWidget : public QWidget
{
    Q_OBJECT

public:
    explicit AddFriendWidget(QString sender,std::unordered_map<std::string,Firend>* friends,QWidget *parent = nullptr);
    ~AddFriendWidget();

protected:
    void closeEvent(QCloseEvent *event);
private slots:
    void on_send_clicked();

private:
    Ui::AddFriendWidget *ui;
    QString sender;
    QString recever;
    QString otherMessage;
    //发送的信息包
    Message m;
    //与服务器通信的socket
    SOCKET sockCli;
    //朋友信息
    std::unordered_map<std::string,Firend>* friends;
};

#endif // ADDFRIENDWIDGET_H
